﻿using sixgod.Common.Model;
using sixgod.Dtos.User;
using SqlSugar;
using System.Linq.Expressions;
using sixgod.Dtos.User.Search;
using DotNetCore.CAP;

namespace sixgod.Service.User;

public interface IUserService:ISimpleClient<Model.User.User>
{
    /// <summary>
    /// 获取所有用户
    /// </summary>
    /// <returns></returns>
    Task<List<UserSelectDto>> GetAllList();

    /// <summary>
    /// 获取分页数据
    /// </summary>
    /// <param name="page"></param>
    /// <param name="exp"></param>
    /// <returns></returns>
    Task<PageResponseResult<Model.User.User>> GetPageList(PageQueryModel page, Expression<Func<Model.User.User,bool>> exp);

    /// <summary>
    /// 获取分页数据
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    Task<PageResponseResult<UserDto>> GetPageList(UserQueryModel data);

    /// <summary>
    /// 新增
    /// </summary>
    /// <param name="user"></param>
    /// <param name="capBus"></param>
    /// <returns></returns>
    Task<bool> InsertAsync(Model.User.User user, ICapPublisher capBus);

    /// <summary>
    /// 编辑
    /// </summary>
    /// <param name="user"></param>
    /// <param name="capBus"></param>
    /// <returns></returns>
    Task UpdateAsync(Model.User.User user, ICapPublisher capBus);

    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="id"></param>
    /// <param name="capBus"></param>
    Task DeleteAsync(string id, ICapPublisher capBus);
}